<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Beta 函数, Beta 分布详解 | 云玩家</title><meta name="keywords" content="数学,函数,分布,概率论"><meta name="author" content="云玩家"><meta name="copyright" content="云玩家"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="推导第一种&amp;nbsp;$\mathrm{Beta}$ 分布一般被用于建模伯努利试验事件成功的概率的概率分布. 什么叫做伯努利试验事件成功的概率? 我们来举个例子.  如果有一枚硬币, 分为正反两面 (不一定均匀) , 那么假设你抛了 $10$ 次, 正面有 $7$ 次, 那么抛这枚硬币是正面的概率是多少呢? 当然我们一般会说是 $7&#x2F;10$ , 但这只是最好的估计. 可能是 $1&#x2F;10$ 吗? 当">
<meta property="og:type" content="article">
<meta property="og:title" content="Beta 函数, Beta 分布详解">
<meta property="og:url" content="http://yunist.cn/math/probability_theory/beta/index.html">
<meta property="og:site_name" content="云玩家">
<meta property="og:description" content="推导第一种&amp;nbsp;$\mathrm{Beta}$ 分布一般被用于建模伯努利试验事件成功的概率的概率分布. 什么叫做伯努利试验事件成功的概率? 我们来举个例子.  如果有一枚硬币, 分为正反两面 (不一定均匀) , 那么假设你抛了 $10$ 次, 正面有 $7$ 次, 那么抛这枚硬币是正面的概率是多少呢? 当然我们一般会说是 $7&#x2F;10$ , 但这只是最好的估计. 可能是 $1&#x2F;10$ 吗? 当">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://yunist.cn/math/probability_theory/beta/beta.png">
<meta property="article:published_time" content="2020-04-13T02:02:05.000Z">
<meta property="article:modified_time" content="2021-09-17T08:49:56.214Z">
<meta property="article:author" content="云玩家">
<meta property="article:tag" content="数学">
<meta property="article:tag" content="函数">
<meta property="article:tag" content="分布">
<meta property="article:tag" content="概率论">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://yunist.cn/math/probability_theory/beta/beta.png"><link rel="shortcut icon" href="/img/favicon.ico"><link rel="canonical" href="http://yunist.cn/math/probability_theory/beta/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//s4.cnzz.com"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><script async="async" data-pjax="data-pjax" src="https://s4.cnzz.com/z_stat.php?id=1278869595&amp;web_id=1278869595"></script><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isanchor: false
}</script><script src="/js/yuntools.js"></script><script id="config-diff">var GLOBAL_CONFIG_SITE = { 
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2021-09-17 16:49:56'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    })(window)</script><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/cnyist/blog/css/font.css"><meta name="generator" content="Hexo 5.4.0"></head><body><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="author-avatar"><img class="avatar-img" src="https://cdn.jsdelivr.net/gh/cnyist/blog/img/avatar.svg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/archives/"><div class="headline">文章</div><div class="length-num">97</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tags/"><div class="headline">标签</div><div class="length-num">40</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/categories/"><div class="headline">分类</div><div class="length-num">27</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/chat/"><i class="fa-fw fas fa-comments"></i><span> 闲聊室</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-user"></i><span> about</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw iconfont icon-Web"></i><span> 镜像站点</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" target="_blank" rel="noopener" href="https://yunist.gitee.io"><i class="fa-fw iconfont icon-gitee-fill-round"></i><span> Gitee Pages</span></a></li></ul></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('/math/probability_theory/beta/beta.png')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">云玩家</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/chat/"><i class="fa-fw fas fa-comments"></i><span> 闲聊室</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-user"></i><span> about</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw iconfont icon-Web"></i><span> 镜像站点</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" target="_blank" rel="noopener" href="https://yunist.gitee.io"><i class="fa-fw iconfont icon-gitee-fill-round"></i><span> Gitee Pages</span></a></li></ul></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">Beta 函数, Beta 分布详解</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2020-04-13T02:02:05.000Z" title="发表于 2020-04-13 10:02:05">2020-04-13</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2021-09-17T08:49:56.214Z" title="更新于 2021-09-17 16:49:56">2021-09-17</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E6%95%B0%E5%AD%A6/">数学</a><i class="fas fa-angle-right post-meta-separator"></i><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E6%95%B0%E5%AD%A6/%E6%A6%82%E7%8E%87%E8%AE%BA/">概率论</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span><span class="post-meta-separator">|</span><span class="post-meta-commentcount"><i class="far fa-comments fa-fw post-meta-icon"></i><span class="post-meta-label">评论数:</span><a href="/math/probability_theory/beta/#post-comment"><span id="twikoo-count"></span></a></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h1 id="推导"><a href="#推导" class="headerlink" title="推导"></a>推导</h1><h2 id="第一种"><a href="#第一种" class="headerlink" title="第一种"></a>第一种</h2><p>&nbsp;$\mathrm{Beta}$ 分布一般被用于建模<strong>伯努利试验事件成功的概率</strong>的概率分布. 什么叫做<strong>伯努利试验事件成功的概率</strong>? 我们来举个例子.</p>
<blockquote>
<p>如果有一枚硬币, 分为正反两面 (不一定均匀) , 那么假设你抛了 $10$ 次, 正面有 $7$ 次, 那么抛这枚硬币是正面的概率是多少呢? 当然我们一般会说是 $7/10$ , 但这只是最好的估计. 可能是 $1/10$ 吗? 当然可能, 但是可能性不高. 这里的 $7/10$ , $1/10$ 就是所谓<strong>伯努利试验事件成功的概率</strong>. 而其服从的分布就是<strong>伯努利试验事件成功的概率</strong>的概率分布.</p>
</blockquote>
<p>二项分布相信大家高中就都已经接触过了<br>$$<br>P(x) = \binom{n}{x}q^x(1-q)^{n-x}<br>$$<br>这是已知参数 $n, q$ 来估计 $x$ , 我们同样可以将其等价地写为 $P(x\mid  q)$ . 那如果我们知道了 $n,x$ , 要如何估计 $q$ 呢? 也就是如何求出 $P(q\mid x)$ (省略了 $n$ 是为了方便写公式, 毕竟两个条件概率都是已知 $n$ 的) .</p>
<p>根据贝叶斯公式, 我们有<br>$$<br>P(q\mid x) = \frac{P(x\mid q)P(q)}{P(x)}<br>$$<br>其中 $P(x)$ 是常量 (因为我们已知 $x$ ) . 而 $P(q)$ 是多少呢? $P(q)$ 被称为先验分布, 在我们对某一随机变量一无所知的时候, 一般可以认为它服从均匀分布. 那么, 就有<br>$$<br>p(q\mid x)\propto P(q\mid x)\propto P(x\mid q)\propto q^x(1-q)^{n-x}<br>$$<br>其中 $p(q\mid x)$ 为随机变量 $Q$ 的概率密度函数, 概率密度函数需要满足在定义域内积分为 $1$ . 我们乘上常数 $k$​ , 使其满足这个性质.</p>

$$
p(q\mid x) = kq^x(1-q)^{n-x}
$$

$$
\begin{aligned}
\int_0^1kq^x(1-q)^{n-x}\,\mathrm{d}q = k\int_0^1q^x(1-q)^{n-x}\,\mathrm{d}q &= 1\\\\
k&=\frac{1}{\int_0^1q^x(1-q)^{n-x}\,\mathrm{d}q}
\end{aligned}
$$


<p>记 $x = a, n-x=b, B(a+1,b+1)=k^{-1}$ , 也就是说<br>$$<br>B(a,b) = \int_0^1q^{a-1}(1-q)^{b-1},\mathrm{d}q<br>$$<br>这个 $B(a,b)$ 即为 $\mathrm{Beta}$ 函数, 这即是 $\mathrm{Beta}$ 函数的由来. 而 $\mathrm{Beta}$ 分布的概率密度函数则为<br>$$<br>f(q)=\frac{1}{B(a,b)}q^{a-1}(1-q)^{b-1}<br>$$</p>
<h2 id="第二种"><a href="#第二种" class="headerlink" title="第二种"></a>第二种</h2><p>假设你和我玩一个游戏, 我说</p>
<blockquote>
<p>我有一个魔盒, 上面有一个按钮. 我每按下一次按钮, 就会均匀的产生一个 $[0,1]$ 之间的随机数. 现在我连按 $10$ 次, 那么你猜猜, 第 $7$ 大的数字是多少? 误差不超过 $0.01$ 就算赢.</p>
</blockquote>
<p>用数学语言来描述就是</p>
<ul>
<li>$X_1,X_2\cdots, X_n\mathop{\sim}\limits^{\mathrm{iid}}Uniform(0,1),$</li>
<li>把这 $n$ 个随机变量排序后得到顺序统计量 $X_{(1)},X_{(2)},\cdots,X_{(n)},$</li>
<li>问 $X_{(k)}$ 的分布是什么</li>
</ul>
<p>对上面的游戏而言, $n=10,k=7$ . 如果我们求出了 $X_{(7)}$ 的分布, 那么用概率密度的极值点去猜测是最好的策略. </p>
<p>我们尝试计算 $X_{(k)}$ 落在区间 $[x,x+\Delta x]$ 的概率 $P(x&lt;X_{(k)}&lt;x+\Delta x)$.</p>
<p> 把 $[0,1]$ 区间分为 $3$ 段, 即 $[0,x),[x,x+\Delta x],(x+\Delta x,1]$ . 假设 $X_{(k)}$ 在区间 $[x,x+\Delta x]$ 中, 我们先考虑一个简单情形:</p>
<ul>
<li>$[x, x+\Delta x]$ 中只有一个点</li>
</ul>
<p>不失一般性, 我们先考虑一个符合上述要求的事件 $E$ .<br>$$<br>\begin{aligned}<br>E={&amp;X_1\in[x,x+\Delta x],\\<br>&amp;X_i\in[0,x);;;;(j=2,\cdots,k),\\<br>&amp;X_j\in(x+\Delta x,1];;;;(i=k+1,\cdots,n)}<br>\end{aligned}<br>$$</p>
<p><img src="2.jpg"></p>
<p>则有<br>$$<br>\begin{aligned}<br>P(E)&amp;=\prod_{i=0}^nP(X_i)\\<br>&amp;=x^{k-1}(1-x-\Delta x)^{n-k}\Delta x\\<br>&amp;=x^{k-1}(1-x)^{n-k}\Delta x+o(\Delta x)<br>\end{aligned}<br>$$<br>其中 $o(\Delta x)$ 表示 $\Delta x$ 的高阶无穷小. 我们来计算一下与 $E$ 事件等价的事件有多少个. 首先, 在 $[x,x+\Delta x]$ 中的数一共有 $n$ 种取法, 然后在 $[0, x)$ 中的数有 $\binom{n-1}{k-1}$ 种取法, 而一旦给定前面的数所在的区间, $(x+\Delta x,1]$ 区间中的数也就给定. 于是一共有 $n\binom{n-1}{k-1}$ 种情况.</p>
<ul>
<li>$[x, x+\Delta x]$ 中有两个点</li>
</ul>
<p>$$<br>\begin{aligned}<br>E’={&amp;X_1,X_2\in[x,x+\Delta x],\\<br>&amp;X_i\in[0,x);;;;(j=3,\cdots,k),\\<br>&amp;X_j\in(x+\Delta x,1];;;;(i=k+1,\cdots,n)}<br>\end{aligned}<br>$$</p>
<p><img src="3.jpg"></p>
<p>那么就有<br>$$<br>\begin{aligned}P(E’)&amp;=\prod_{i=0}^nP(X_i)\\&amp;=x^{k-2}(1-x-\Delta x)^{n-k}(\Delta x)^2\\&amp;=o(\Delta x)\end{aligned}<br>$$</p>
<p>也就是说, 在 $[x, x+\Delta x]$ 中的数字超过 $1$ 个, 那么概率就是 $o(\Delta x)$ . </p>
<p>因此 $X_{(k)}$ 的概率密度函数为<br>$$<br>\begin{aligned}<br>f(x) &amp;= \lim_{\Delta x\rightarrow0}\frac{P(x&lt;X_{(k)}&lt;x+\Delta x)}{\Delta x}\\<br>&amp;=n\binom{n-1}{k-1}x^{k-1}(1-x)^{n-k}\\<br>&amp;=\frac{n!}{(k-1)!(n-k)!}x^{k-1}(1-x)^{n-k}\\<br>&amp;=\frac{\Gamma(n+1)}{\Gamma(k)\Gamma(n-k+1)}x^{k-1}(1-x)^{n-k}<br>\end{aligned}<br>$$<br>令 $k=a,n-k+1=b$ , 上式可写为<br>$$<br>f(x) = \frac{\Gamma(a+b)}{\Gamma(a)\Gamma(b)}x^{a-1}(1-x)^{b-1}<br>$$<br>下面我们会证明 $B(a,b)=\frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}$ , 也就是说<br>$$<br>f(x)=\frac{1}{B(a,b)}x^{a-1}(1-x)^{b-1}<br>$$<br>&nbsp;$\frac{1}{B(a,b)}x^{a-1}(1-x)^{b-1}$ 即为 $Beta$ 分布的概率密度函数.</p>
<p>看起来完全不同的两种问题, 居然能推导出完全相同的式子!</p>
<h1 id="Beta-函数与-Gamma-函数的关系"><a href="#Beta-函数与-Gamma-函数的关系" class="headerlink" title="Beta 函数与 Gamma 函数的关系"></a>Beta 函数与 Gamma 函数的关系</h1><p><img src="1.png"></p>
<p>假设向长度为 $1$ 的桌面丢一颗红球, 设红球与桌面最左边的距离为 $x$ , 那么随意再丢一颗白球, 在红球左边的概率为 $x$ . 那么丢 $n$ 次白球, 其中再红球左边的次数为 $k$ 次, 那么随机变量 $K$ 显然服从参数为 $n, x$ 的二项分布. 即 $K\sim Binomial(n,x)$ . 那么有<br>$$<br>P(K=k\mid x)=\binom{n}{k}x^k(1-x)^{n-k}<br>$$<br>根据贝叶斯公式, 有<br>$$<br>P(K=k,x) = P(K=k\mid x)P(x)<br>$$<br>由于 $P(x)$ 是均匀分布. 那么求边缘概率有<br>$$<br>\begin{aligned}<br>P(K=k) &amp;= \sum_{x}P(K=k\mid x)P(x)\\<br>&amp;=\int_0^1\binom{n}{k}x^k(1-x)^{n-k},\mathrm{d}x\\<br>&amp;=\binom{n}{k}\int_0^1x^k(1-x)^{n-k},\mathrm{d}x<br>\end{aligned}<br>$$<br>现在我们换一种方式丢球, 等价的求出 $P(K=k)$ . 先把 $n+1$ 个球全部丢出, 然后任选一个球为红球, 那么此时任意一个球被选到的概率都是 $1/(n+1)$ 因此其左边球的数量为 $n$ 的概率也都为 $1/(n+1)$ (每颗球的左边球数量都不同, 而且数量范围在 $0\sim n$ ) . 因此我们有<br>$$<br>\begin{aligned}<br>\binom{n}{k}\int_0^1x^k(1-x)^{n-k},\mathrm{d}x&amp;=\frac{1}{n+1}\\<br>\int_0^1x^k(1-x)^{n-k},\mathrm{d}x&amp;=\frac{k!(n-k)!}{(n+1)!}<br>\end{aligned}<br>$$<br>令 $k=a-1,n-k=b-1$, 根据 $\mathrm{Gamma}$ 函数的定义, 有<br>$$<br>\begin{aligned}<br>\int_0^1x^{a-1}(1-x)^{b-1},\mathrm{d}x&amp;=\frac{(a-1)!(b-1)!}{(a+b-1)!}\\<br>B(a,b)&amp;=\frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}<br>\end{aligned}<br>$$</p>
<hr>
<h1 id="Beta-Binomial-共轭"><a href="#Beta-Binomial-共轭" class="headerlink" title="Beta-Binomial 共轭"></a>Beta-Binomial 共轭</h1><p>还记得上面的游戏吗? 为了降低难度, 我又说:</p>
<blockquote>
<p>我再次按下 $5$ 次按钮, 然后得到 $5$ 个 $[0,1]$ 之间的随机数, 然后我会告诉你这 $5$ 个数与之前第 $7$ 大的数字相比, 谁大谁小, 然后你继续猜第 $7$ 大的数字是多少.</p>
</blockquote>
<p>假设这 $5$ 个数有 $3$ 个大于第 $7$ 大的数字, $2$ 个小于.</p>
<p>实际上, 这个 “降低难度” 的游戏其实是同一个游戏, 把它重新表达一下, 其实和下面这个游戏是等价的:</p>
<blockquote>
<p>我有一个魔盒, 上面有一个按钮. 我每按下一次按钮, 就会均匀的产生一个 $[0,1]$ 之间的随机数. 现在我连按 $10+5$ 次, 那么你猜猜, 第 $7+2$ 大的数字是多少? 误差不超过 $0.01$ 就算赢.</p>
</blockquote>
<p>也就是说, 本来 $X_{(7)}$ 的分布是 $Beta(7,10-7+1)$ . 给定另外的数据 $M_1\sim B(5,X_{(7)}),M_2=5-M_1$  (二项分布, $M_1$ 是小于第 $7$ 大数字的个数, $M_2$ 是大于), 那么 $X_{(7)}$ 的分布就会变成 $Beta(7+M_1,10-7+1+M_2)$ .</p>
<p>推广至一般情况, 即</p>
<ul>
<li>$X_1,X_2,\cdots,X_n\mathop\sim\limits^{\mathrm{iid}}Uniform(0,1)$ , 排序后对应的顺序统计量为 $X_{(1)}, X_{(2)},\cdots,X_{(n)}$ ,</li>
<li>$Y_1,Y_2,\cdots,Y_m\mathop\sim\limits^{\mathrm{iid}}Uniform(0,1)$ , 且有 $m_1$ 个比 $X_{(k)}$ 大, $m_2$ 个比 $X_{(k)}$ 小,</li>
<li>$p = X_{(k)}$ , 求 $P(p\mid Y_1,Y_2,\cdots,Y_m)$ 的分布</li>
</ul>
<p>贝叶斯参数估计的基本过程是<br>$$<br>先验分布+数据的知识=后验分布<br>$$<br>上面第一点其实就是先验分布即 $Beta(p\mid k,n-k+1)$ , 第二点就是数据的知识 $m_1,m_2$ ,第三点就是后验分布即 $Beta(p\mid k+m_1,n-k+1+m_2)$ .</p>
<p>合起来就是<br>$$<br>Beta(p\mid k,n-k+1)+BinomCount(m_1,m_2)=Beta(p\mid k+m_1,n-k+1+m_2)<br>$$<br>同样我们可以写为<br>$$<br>Beta(p\mid a,b)+BinomCount(m_1,m_2)=Beta(p\mid a+m_1,b+m_2)<br>$$<br>这就是所谓 $\textbf{Beta-Binomial}$ <strong>共轭</strong> .</p>
<h1 id="Dirichlet-分布"><a href="#Dirichlet-分布" class="headerlink" title="Dirichlet 分布"></a>Dirichlet 分布</h1><p>&nbsp;$\mathrm{Dirichlet}$ 分布其实就是多维的 $\mathrm{Beta}$ 分布. 继续上面的游戏, 我可以说:</p>
<blockquote>
<p>我再按 $20$ 次按钮, 那么你猜猜, 第 $7$ 大的数字和第 $14$ 大的数字分别是多少? </p>
</blockquote>
<p>按照上面的方式, 转换为数学语言即</p>
<ul>
<li>$X_1,X_2\cdots, X_n\mathop{\sim}\limits^{\mathrm{iid}}Uniform(0,1),$</li>
<li>把这 $n$ 个随机变量排序后得到顺序统计量 $X_{(1)},X_{(2)},\cdots,X_{(n)},$</li>
<li>问 $X_{(k_1)}$ 与 $X_{(k_1+k_2)}$ 的联合分布是什么</li>
</ul>
<p><img src="4.jpg"></p>
<p>同样推导过程, 有<br>$$<br>\begin{aligned}&amp;,;;;;P\Big(X_{(k1)}\in (x_1,x_1+\Delta x),X_{(k_1+k_2)}\in(x_2, x_2+\Delta x)\Big)\\&amp;=n(n-1)\binom{n-2}{k_1-1,k_2-1}{x_1}^{k_1-1}{x_2}^{k_2-1}{x_3}^{n-k_2-k_1}(\Delta x)^2\\&amp;=\frac{n!}{(k_1-1)!(k_2-1)!(n-k_1-k_2)!}{x_1}^{k_1-1}{x_2}^{k_2-1}{x_3}^{n-k_2-k_1}(\Delta x)^2\\&amp;=\frac{\Gamma (n+1)}{\Gamma (k_1)\Gamma (k_2)\Gamma (n-k_1-k_2+1)}{x_1}^{k_1-1}{x_2}^{k_2-1}{x_3}^{n-k_2-k_1}(\Delta x)^2\end{aligned}<br>$$<br>因此 $X_{(k_1)}$ 与 $X_{(k_1+k_2)}$ 的联合分布为<br>$$<br>f(x_1,x_2,x_3)=\frac{\Gamma (n+1)}{\Gamma (k_1)\Gamma (k_2)\Gamma (n-k_1-k_2+1)}{x_1}^{k_1-1}{x_2}^{k_2-1}{x_3}^{n-k_2-k_1}<br>$$</p>
<p><strong>这里其实只有两个变量即 $x_1, x_2$ , 而 $x_3 = 1-x_1-x_2$ , 写成三个变量的形式只是为了对称.</strong></p>
<p>令 $k_1=\alpha_1,k_2=\alpha_2,n-k_1-k_2+1=\alpha_3$ 有<br>$$<br>f(x_1,x_2,x_3)=\frac{\Gamma (\alpha_1+\alpha_2+\alpha_3)}{\Gamma (\alpha_1)\Gamma (\alpha_2)\Gamma (\alpha_3)}{x_1}^{\alpha_1-1}{x_2}^{\alpha_2-1}{x_3}^{\alpha_3-1}<br>$$</p>
<h1 id="Dirichlet-Multinomial-共轭"><a href="#Dirichlet-Multinomial-共轭" class="headerlink" title="Dirichlet-Multinomial 共轭"></a>Dirichlet-Multinomial 共轭</h1><p>同样的推导, 这里就不细说了, 结果就是<br>$$<br>Dir(\vec p\mid \vec k) + MultCount(\vec m)=Dir(\vec p\mid \vec k+\vec m)<br>$$<br>其中 $\vec p=(p_1,p_2,p_3),p_3=1-p_1-p_2$ (同样为了更对称) .</p>
<p>当然, 我们还可以继续提高维度, 得到更高维的 $\mathrm{Dirichlet}$ 分布以及 $\mathrm{Dirichlet-Multinomial}$ 共轭.  一般形式的 $\mathrm{Dirichlet}$ 分布定义如下<br>$$<br>Dir(\vec p\mid\vec \alpha)=\frac{\Gamma(\sum_{k=1}^K \alpha_k)}{\sum_{k=1}^K\Gamma(\alpha_k)}\prod_{k=1}^K{p_k}^{\alpha_k-1}<br>$$<br>多项分布定义为<br>$$<br>Mult(\vec n\mid \vec p,N)=\binom{N}{\vec n}\prod_{k=1}^K{p_k}^{n_k}<br>$$<br>这两个分布是共轭关系.</p>
<h1 id="Deta-Dirichlet-分布的期望"><a href="#Deta-Dirichlet-分布的期望" class="headerlink" title="Deta, Dirichlet 分布的期望"></a>Deta, Dirichlet 分布的期望</h1><p>如果 $p\sim Beta(t\mid \alpha, \beta)$ , 则<br>$$<br>\begin{aligned}E(p)&amp;=\int_0^1t\cdot \frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}t^{\alpha-1}(1-t)^{\beta-1},\mathrm{d}t\\&amp;=\frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}\int_0^1t^{\alpha}(1-t)^{\beta-1},\mathrm{d}t\\\end{aligned}<br>$$<br>而<br>$$<br>\int_0^1Beta(t\mid \alpha+1,\beta)=\int_0^1\frac{\Gamma(\alpha+\beta+1)}{\Gamma(\alpha+1)\Gamma(\beta)}t^{\alpha}(1-t)^{\beta-1},\mathrm{d}t=\frac{\Gamma(\alpha+\beta+1)}{\Gamma(\alpha+1)\Gamma(\beta)}\int_0^1t^{\alpha}(1-t)^{\beta-1},\mathrm{d}t=1<br>$$<br>于是<br>$$<br>\begin{aligned}E(p)&amp;=\frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}\int_0^1t^{\alpha}(1-t)^{\beta-1},\mathrm{d}t\\&amp;=\frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}\frac{\Gamma(\alpha+1)\Gamma(\beta)}{\Gamma(\alpha+\beta+1)}\\&amp;=\frac{\alpha}{\alpha+\beta}\end{aligned}<br>$$<br>对于 $\mathrm{Beta}$ 分布的多维形式 $\mathrm{Dirichlet}$ 分布也有类似的结论, 即如果 $\vec p\sim Dir(\vec t\mid\vec\alpha)$ , 那么有<br>$$<br>E(\vec p)=\left(\frac{\alpha_1}{\sum_{k=1}^K\alpha_k},\frac{\alpha_2}{\sum_{k=1}^K\alpha_k},\cdots,\frac{\alpha_K}{\sum_{k=1}^K\alpha_k}\right)<br>$$</p>
<h1 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h1><h2 id="网络资料"><a href="#网络资料" class="headerlink" title="网络资料"></a>网络资料</h2><ul>
<li><p><a target="_blank" rel="noopener" href="https://blog.csdn.net/lucien_zong/article/details/50041341">认识Beta函数</a></p>
</li>
<li><p><a target="_blank" rel="noopener" href="https://www.zhihu.com/question/30269898">如何通俗理解 beta 分布？</a></p>
</li>
</ul>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">云玩家</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="http://yunist.cn/math/probability_theory/beta/">http://yunist.cn/math/probability_theory/beta/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="http://yunist.cn" target="_blank">云玩家</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/%E6%95%B0%E5%AD%A6/">数学</a><a class="post-meta__tags" href="/tags/%E5%87%BD%E6%95%B0/">函数</a><a class="post-meta__tags" href="/tags/%E5%88%86%E5%B8%83/">分布</a><a class="post-meta__tags" href="/tags/%E6%A6%82%E7%8E%87%E8%AE%BA/">概率论</a></div><div class="post_share"><div class="social-share" data-image="/math/probability_theory/beta/beta.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><!-- - var pagination_cover = prev.cover === false ? prev.randomcover : prev.cover--><a href="/hexo/butterfly_modify/"><img class="prev-cover" src="https://cdn.jsdelivr.net/gh/cnyist/blog/hexo/butterfly_modify/butterfly_modify.jpeg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">Butterfly 主题魔改记录</div></div></a></div><!-- - var pagination_cover = next.cover == false ? next.randomcover : next.cover--><div class="next-post pull-right"><a href="/scribble/build_nav/"><img class="next-cover" src="https://cdn.jsdelivr.net/gh/cnyist/blog/scribble/build_nav/build_nav.png" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">如何快速搭建一个属于自己的网址导航</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span> 相关推荐</span></div><div class="relatedPosts-list"><div><a href="/math/probability_theory/gamma/" title="Gamma 函数详解"><img class="cover" src="https://cdn.jsdelivr.net/gh/cnyist/blog/math/probability_theory/gamma/gamma.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-04-08</div><div class="title">Gamma 函数详解</div></div></a></div><div><a href="/math/probability_theory/hypergeometric_distribution/" title="超几何分布抽取概率证明"><img class="cover" src="https://cdn.jsdelivr.net/gh/cnyist/blog/math/probability_theory/hypergeometric_distribution/hypergeometric_distribution.jpeg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-05-23</div><div class="title">超几何分布抽取概率证明</div></div></a></div><div><a href="/scribble/obsessive_LaTeX/" title="强迫症的 LaTeX"><img class="cover" src="https://cdn.jsdelivr.net/gh/cnyist/blog/scribble/obsessive_LaTeX/obsessive_LaTeX.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-04-23</div><div class="title">强迫症的 LaTeX</div></div></a></div><div><a href="/ML/model/LDA/" title="LDA 详解"><img class="cover" src="https://cdn.jsdelivr.net/gh/cnyist/blog/ML/model/LDA/LDA.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-04-23</div><div class="title">LDA 详解</div></div></a></div><div><a href="/math/linear_algebra/geometric_det/" title="行列式几何意义的证明"><img class="cover" src="https://cdn.jsdelivr.net/gh/cnyist/blog/math/linear_algebra/geometric_det/geometric_det.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-05-30</div><div class="title">行列式几何意义的证明</div></div></a></div><div><a href="/math/linear_algebra/prove_1/" title="线性代数命题证明 (一)"><img class="cover" src="https://cdn.jsdelivr.net/gh/cnyist/blog/math/linear_algebra/prove_1/prove_1.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-06-05</div><div class="title">线性代数命题证明 (一)</div></div></a></div></div></div><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div id="twikoo-wrap"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="card-info-avatar is-center"><img class="avatar-img" src="https://cdn.jsdelivr.net/gh/cnyist/blog/img/avatar.svg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/><div class="author-info__name">云玩家</div><div class="author-info__description">云玩家's blog</div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">97</div></a></div><div class="card-info-data-item is-center"><a href="/tags/"><div class="headline">标签</div><div class="length-num">40</div></a></div><div class="card-info-data-item is-center"><a href="/categories/"><div class="headline">分类</div><div class="length-num">27</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/xxxxxx"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/cnyist" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="https://blog.csdn.net/chnyist" target="_blank" title="CSDN"><i class="fas iconfont icon-CN_csdnnet"></i></a><a class="social-icon" href="https://www.zhihu.com/people/cnyist" target="_blank" title="知乎"><i class="fas iconfont icon-zhihu"></i></a><a class="social-icon" href="mailto:yunist@qq.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E6%8E%A8%E5%AF%BC"><span class="toc-number">1.</span> <span class="toc-text">推导</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%AC%AC%E4%B8%80%E7%A7%8D"><span class="toc-number">1.1.</span> <span class="toc-text">第一种</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%AC%AC%E4%BA%8C%E7%A7%8D"><span class="toc-number">1.2.</span> <span class="toc-text">第二种</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#Beta-%E5%87%BD%E6%95%B0%E4%B8%8E-Gamma-%E5%87%BD%E6%95%B0%E7%9A%84%E5%85%B3%E7%B3%BB"><span class="toc-number">2.</span> <span class="toc-text">Beta 函数与 Gamma 函数的关系</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#Beta-Binomial-%E5%85%B1%E8%BD%AD"><span class="toc-number">3.</span> <span class="toc-text">Beta-Binomial 共轭</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#Dirichlet-%E5%88%86%E5%B8%83"><span class="toc-number">4.</span> <span class="toc-text">Dirichlet 分布</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#Dirichlet-Multinomial-%E5%85%B1%E8%BD%AD"><span class="toc-number">5.</span> <span class="toc-text">Dirichlet-Multinomial 共轭</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#Deta-Dirichlet-%E5%88%86%E5%B8%83%E7%9A%84%E6%9C%9F%E6%9C%9B"><span class="toc-number">6.</span> <span class="toc-text">Deta, Dirichlet 分布的期望</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99"><span class="toc-number">7.</span> <span class="toc-text">参考资料</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%BD%91%E7%BB%9C%E8%B5%84%E6%96%99"><span class="toc-number">7.1.</span> <span class="toc-text">网络资料</span></a></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><!-- - let post_cover = article.cover--><div class="aside-list-item"><a class="thumbnail" href="/math/set_theory/unique_ordinal/" title="序数的唯一性"><img src="https://cdn.jsdelivr.net/gh/cnyist/blog/math/set_theory/unique_ordinal/unique_ordinal.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="序数的唯一性"/></a><div class="content"><a class="title" href="/math/set_theory/unique_ordinal/" title="序数的唯一性">序数的唯一性</a><time datetime="2022-01-12T08:26:12.000Z" title="发表于 2022-01-12 16:26:12">2022-01-12</time></div></div><!-- - let post_cover = article.cover--><div class="aside-list-item"><a class="thumbnail" href="/math/mathematical_analysis/mathematical_analysis_practice/3/3-1/" title="(史济怀) 数学分析教程上册第 3 版-练习题 3.1"><img src="https://cdn.jsdelivr.net/gh/cnyist/blog/math/mathematical_analysis/mathematical_analysis_practice/3/3-1/math.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="(史济怀) 数学分析教程上册第 3 版-练习题 3.1"/></a><div class="content"><a class="title" href="/math/mathematical_analysis/mathematical_analysis_practice/3/3-1/" title="(史济怀) 数学分析教程上册第 3 版-练习题 3.1">(史济怀) 数学分析教程上册第 3 版-练习题 3.1</a><time datetime="2021-10-19T00:30:55.000Z" title="发表于 2021-10-19 08:30:55">2021-10-19</time></div></div><!-- - let post_cover = article.cover--><div class="aside-list-item"><a class="thumbnail" href="/math/mathematical_analysis/mathematical_analysis_practice/2/2-11/" title="(史济怀) 数学分析教程上册第 3 版-练习题 2.11"><img src="https://cdn.jsdelivr.net/gh/cnyist/blog/math/mathematical_analysis/mathematical_analysis_practice/2/2-11/2-11.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="(史济怀) 数学分析教程上册第 3 版-练习题 2.11"/></a><div class="content"><a class="title" href="/math/mathematical_analysis/mathematical_analysis_practice/2/2-11/" title="(史济怀) 数学分析教程上册第 3 版-练习题 2.11">(史济怀) 数学分析教程上册第 3 版-练习题 2.11</a><time datetime="2021-09-25T03:37:28.000Z" title="发表于 2021-09-25 11:37:28">2021-09-25</time></div></div><!-- - let post_cover = article.cover--><div class="aside-list-item"><a class="thumbnail" href="/math/mathematical_analysis/mathematical_analysis_practice/2/2-10/" title="(史济怀) 数学分析教程上册第 3 版-练习题 2.10"><img src="https://cdn.jsdelivr.net/gh/cnyist/blog/math/mathematical_analysis/mathematical_analysis_practice/2/2-10/2-10.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="(史济怀) 数学分析教程上册第 3 版-练习题 2.10"/></a><div class="content"><a class="title" href="/math/mathematical_analysis/mathematical_analysis_practice/2/2-10/" title="(史济怀) 数学分析教程上册第 3 版-练习题 2.10">(史济怀) 数学分析教程上册第 3 版-练习题 2.10</a><time datetime="2021-09-22T07:36:49.000Z" title="发表于 2021-09-22 15:36:49">2021-09-22</time></div></div><!-- - let post_cover = article.cover--><div class="aside-list-item"><a class="thumbnail" href="/math/mathematical_analysis/mathematical_analysis_practice/2/2-9/" title="(史济怀) 数学分析教程上册第 3 版-练习题 2.9"><img src="https://cdn.jsdelivr.net/gh/cnyist/blog/math/mathematical_analysis/mathematical_analysis_practice/2/2-9/2-9.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="(史济怀) 数学分析教程上册第 3 版-练习题 2.9"/></a><div class="content"><a class="title" href="/math/mathematical_analysis/mathematical_analysis_practice/2/2-9/" title="(史济怀) 数学分析教程上册第 3 版-练习题 2.9">(史济怀) 数学分析教程上册第 3 版-练习题 2.9</a><time datetime="2021-09-20T08:19:06.000Z" title="发表于 2021-09-20 16:19:06">2021-09-20</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2022 By 云玩家</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer><script>document.getElementById('web_bg').style = 'background-image: url("' + get_rand_jsd_pic('cnyist', 'banner@master', '/', 70, '-min.jpg') + '")'</script></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><div class="search-dialog__title" id="local-search-title">本地搜索</div><div id="local-input-panel"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div></div><hr/><div id="local-search-results"></div><span class="search-close-button"><i class="fas fa-times"></i></span></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/search/local-search.js"></script><div class="js-pjax"><script>if (!window.MathJax) {
  window.MathJax = {
    loader: {
      source: {
        '[tex]/amsCd': '[tex]/amscd'
      }
    },
    tex: {
      inlineMath: [ ['$','$'], ["\\(","\\)"]],
      tags: 'ams'
    },
    options: {
      renderActions: {
        findScript: [10, doc => {
          for (const node of document.querySelectorAll('script[type^="math/tex"]')) {
            const display = !!node.type.match(/; *mode=display/)
            const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display)
            const text = document.createTextNode('')
            node.parentNode.replaceChild(text, node)
            math.start = {node: text, delim: '', n: 0}
            math.end = {node: text, delim: '', n: 0}
            doc.math.push(math)
          }
        }, ''],
        addClass: [200,() => {
          document.querySelectorAll('mjx-container:not([display=\'true\']').forEach( node => {
            const target = node.parentNode
            if (!target.classList.contains('has-jax')) {
              target.classList.add('mathjax-overflow')
            }
          })
        }, '', false]
      }
    }
  }
  
  const script = document.createElement('script')
  script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js'
  script.id = 'MathJax-script'
  script.async = true
  document.head.appendChild(script)
} else {
  MathJax.startup.document.state(0)
  MathJax.texReset()
  MathJax.typeset()
}</script><script>(()=>{
  const $countDom = document.getElementById('twikoo-count')
  const init = () => {
    let initData = {
      el: '#twikoo-wrap',
      envId: 'yunist-147dfe',
      region: ''
    }

    if (false) {
      const otherData = false
      initData = Object.assign(initData, otherData)
    }
    
    twikoo.init(initData)
  }

  const getCount = () => {
    twikoo.getCommentsCount({
      envId: 'yunist-147dfe',
      region: '',
      urls: [window.location.pathname],
      includeReply: false
    }).then(function (res) {
      $countDom.innerText = res[0].count
    }).catch(function (err) {
      console.error(err);
    });
  }

  const loadTwikoo = (bool = false) => {
    if (typeof twikoo === 'object') {
      init()
      bool && $countDom && setTimeout(getCount,0)
    } else {
      getScript('https://cdn.jsdelivr.net/npm/twikoo/dist/twikoo.all.min.js').then(()=> {
        init()
        bool && $countDom && setTimeout(getCount,0)
      })
    }
  }

  if ('Twikoo' === 'Twikoo' || !false) {
    if (false) btf.loadComment(document.getElementById('twikoo-wrap'), loadTwikoo)
    else loadTwikoo(true)
  } else {
    window.loadOtherComment = () => {
      loadTwikoo()
    }
  }
})()</script></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>